Skip to content

feat(instrumentation-aws-sdk): add gen ai metrics for bedrock #2771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 12, 2025

Conversation

anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Mar 27, 2025

Which problem is this PR solving?

  • Gen AI defines metrics that should be applied for operations like bedrock runtime

Short description of the changes

  • Allows propagating meter to service extensions
  • Passes start time to service extensions to allow them to compute operation duration as needed
  • Implement metrics for bedrock service extension
  • Refactor tests to share a single instrumentation instance

/cc @trentm @codefromthecrypt

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.69%. Comparing base (f6bc4cc) to head (c050b89).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2771      +/-   ##
==========================================
+ Coverage   89.67%   89.69%   +0.02%     
==========================================
  Files         184      184              
  Lines        8946     8966      +20     
  Branches     1834     1835       +1     
==========================================
+ Hits         8022     8042      +20     
  Misses        924      924              
Files with missing lines Coverage Δ
...entelemetry-instrumentation-aws-sdk/src/aws-sdk.ts 92.77% <100.00%> (+0.17%) ⬆️
...entelemetry-instrumentation-aws-sdk/src/semconv.ts 100.00% <100.00%> (ø)
...ntation-aws-sdk/src/services/ServicesExtensions.ts 96.87% <100.00%> (+0.32%) ⬆️
...umentation-aws-sdk/src/services/bedrock-runtime.ts 98.89% <100.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anuraaga
Copy link
Contributor Author

Thanks @trentm applied the cleanups. Apologies for the delay finally back to work from kubecon

Copy link
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM. One comment on the init() method below.

@blumamir @jj22ee @trivikr Any comments on the ServiceExtension changes adding metrics support?

@anuraaga
Copy link
Contributor Author

Thanks - updated semconv

Copy link
Contributor

@jj22ee jj22ee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trentm The metrics support in ServiceExtension looks good, no concern from me.

@jj22ee
Copy link
Contributor

jj22ee commented Apr 25, 2025

LGTM!

There is a conflict with main branch right now, most likely due to another Bedrock related PR that got merged from #2777, but I think there should be little to resolve.

@anuraaga
Copy link
Contributor Author

Sorry for the delay @jj22ee, resolved the conflict

Copy link
Contributor

@jj22ee jj22ee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's another conflict, but it must likely be package-lock.json.

@jj22ee jj22ee added the has:owner-approval Approved by Component Owner label May 9, 2025
@trentm trentm merged commit 64fcbf3 into open-telemetry:main May 12, 2025
21 checks passed
@dyladan dyladan mentioned this pull request May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants